.class public Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;
.super Landroid/support/v4/view/PagerAdapter;
.source "SpicyDealsViewPagerAdapter.java"

# interfaces
.implements Lcom/viewpagerindicator/TitleProvider;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$PostWorker;,
        Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$UpdateAdapter;,
        Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$downloadOldPostsAsyncTask;
    }
.end annotation


# static fields
#the value of this static final field might be set in the static constructor
.field public static final DEBUG:Z = false

.field public static final PREFS_NAME:Ljava/lang/String; = "BlogApp"

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private activity:Landroid/app/Activity;

.field private apiManager:Lcom/opongo/blogapp/manager/APIManager;

.field private final context:Landroid/content/Context;

.field protected dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

.field private editor:Landroid/content/SharedPreferences$Editor;

.field private es:Ljava/util/concurrent/ExecutorService;

.field private filterDate:I

.field private filterDateStrings:[Ljava/lang/String;

.field private filterOrder:I

.field private filterOrderStrings:[Ljava/lang/String;

.field private footerViewLoading:Landroid/view/View;

.field private mAdapterArray:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/opongo/android/custom/PostListAdapter;",
            ">;"
        }
    .end annotation
.end field

.field private order:[Ljava/lang/String;

.field protected positionInDetailView:I

.field private postPage:I

.field protected post_id:I

.field protected query:Ljava/lang/String;

.field protected queryLimit:I

.field private scrollPosition:[I

.field private settings:Landroid/content/SharedPreferences;

.field private titles:[Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 42
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->DEBUG:Z

    .line 43
    const-class v0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->TAG:Ljava/lang/String;

    .line 40
    return-void
.end method

.method public constructor <init>(Landroid/app/Activity;Landroid/content/Context;Lcom/opongo/blogapp/manager/DatabaseManager;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V
    .locals 9
    .parameter "activity"
    .parameter "context"
    .parameter "dbManager"
    .parameter "query"
    .parameter "titles"
    .parameter "order"

    .prologue
    const/4 v8, 0x3

    const/4 v7, 0x2

    const/4 v6, 0x1

    const/4 v5, 0x0

    .line 84
    invoke-direct {p0}, Landroid/support/v4/view/PagerAdapter;-><init>()V

    .line 54
    iput v6, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->postPage:I

    .line 56
    const/16 v3, 0x14

    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->queryLimit:I

    .line 61
    iput v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->post_id:I

    .line 62
    iput v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->positionInDetailView:I

    .line 68
    invoke-static {v6}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v3

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->es:Ljava/util/concurrent/ExecutorService;

    .line 70
    new-array v3, v8, [Ljava/lang/String;

    const-string v4, "date"

    aput-object v4, v3, v5

    const-string v4, "spicy"

    aput-object v4, v3, v6

    const-string v4, "comments"

    aput-object v4, v3, v7

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrderStrings:[Ljava/lang/String;

    .line 71
    new-array v3, v8, [Ljava/lang/String;

    const-string v4, "today"

    aput-object v4, v3, v5

    const-string v4, "yesterday"

    aput-object v4, v3, v6

    const-string v4, "week"

    aput-object v4, v3, v7

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDateStrings:[Ljava/lang/String;

    .line 73
    iput v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    .line 74
    iput v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    .line 88
    iput-object p2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->context:Landroid/content/Context;

    .line 89
    iput-object p1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 90
    iput-object p3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    .line 91
    iput-object p4, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->query:Ljava/lang/String;

    .line 92
    new-instance v3, Lcom/opongo/blogapp/manager/APIManager;

    invoke-direct {v3, p2}, Lcom/opongo/blogapp/manager/APIManager;-><init>(Landroid/content/Context;)V

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    .line 93
    iput-object p5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    .line 94
    array-length v3, p5

    new-array v3, v3, [I

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    .line 95
    iput-object p6, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->order:[Ljava/lang/String;

    .line 97
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    array-length v3, p5

    if-lt v1, v3, :cond_1

    .line 101
    const-string v3, "BlogApp"

    invoke-virtual {p1, v3, v5}, Landroid/app/Activity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v3

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->settings:Landroid/content/SharedPreferences;

    .line 102
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->settings:Landroid/content/SharedPreferences;

    invoke-interface {v3}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->editor:Landroid/content/SharedPreferences$Editor;

    .line 104
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->settings:Landroid/content/SharedPreferences;

    const-string v4, "filterDate"

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    .line 105
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->settings:Landroid/content/SharedPreferences;

    const-string v4, "filterOrder"

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    .line 107
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    .line 110
    sget-boolean v3, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->DEBUG:Z

    if-eqz v3, :cond_0

    .line 111
    const-string v2, "SELECT * FROM blogtyp WHERE 1"

    .line 113
    .local v2, q:Ljava/lang/String;
    invoke-virtual {p3, v2}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 114
    .local v0, cursor:Landroid/database/Cursor;
    const-string v3, "TestCursor"

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "SizeBlogtype: "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 115
    :goto_1
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v3

    if-nez v3, :cond_2

    .line 127
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 130
    .end local v0           #cursor:Landroid/database/Cursor;
    .end local v2           #q:Ljava/lang/String;
    :cond_0
    return-void

    .line 98
    :cond_1
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    aput v5, v3, v1

    .line 97
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 116
    .restart local v0       #cursor:Landroid/database/Cursor;
    .restart local v2       #q:Ljava/lang/String;
    :cond_2
    const-string v3, "TestCursor"

    .line 117
    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "ID: "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 119
    const-string v5, "_id"

    invoke-interface {v0, v5}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    .line 118
    invoke-interface {v0, v5}, Landroid/database/Cursor;->getInt(I)I

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 120
    const-string v5, " Title: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 122
    const-string v5, "title"

    invoke-interface {v0, v5}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    .line 121
    invoke-interface {v0, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 123
    const-string v5, " BT: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 125
    const-string v5, "blogtype"

    invoke-interface {v0, v5}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    .line 124
    invoke-interface {v0, v5}, Landroid/database/Cursor;->getInt(I)I

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 117
    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 116
    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 7
    .parameter "context"

    .prologue
    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 76
    invoke-direct {p0}, Landroid/support/v4/view/PagerAdapter;-><init>()V

    .line 54
    iput v4, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->postPage:I

    .line 56
    const/16 v1, 0x14

    iput v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->queryLimit:I

    .line 61
    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->post_id:I

    .line 62
    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->positionInDetailView:I

    .line 68
    invoke-static {v4}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v1

    iput-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->es:Ljava/util/concurrent/ExecutorService;

    .line 70
    new-array v1, v6, [Ljava/lang/String;

    const-string v2, "date"

    aput-object v2, v1, v3

    const-string v2, "spicy"

    aput-object v2, v1, v4

    const-string v2, "comments"

    aput-object v2, v1, v5

    iput-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrderStrings:[Ljava/lang/String;

    .line 71
    new-array v1, v6, [Ljava/lang/String;

    const-string v2, "today"

    aput-object v2, v1, v3

    const-string v2, "yesterday"

    aput-object v2, v1, v4

    const-string v2, "week"

    aput-object v2, v1, v5

    iput-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDateStrings:[Ljava/lang/String;

    .line 73
    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    .line 74
    iput v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    .line 77
    iput-object p1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->context:Landroid/content/Context;

    .line 78
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    array-length v1, v1

    if-lt v0, v1, :cond_0

    .line 81
    return-void

    .line 79
    :cond_0
    iget-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    aput v3, v1, v0

    .line 78
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method static synthetic access$0()Ljava/lang/String;
    .locals 1

    .prologue
    .line 43
    sget-object v0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 64
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$10(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Ljava/util/concurrent/ExecutorService;
    .locals 1
    .parameter

    .prologue
    .line 68
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->es:Ljava/util/concurrent/ExecutorService;

    return-object v0
.end method

.method static synthetic access$11(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 55
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->footerViewLoading:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$12(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)[I
    .locals 1
    .parameter

    .prologue
    .line 49
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    return-object v0
.end method

.method static synthetic access$2(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)[Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 47
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->order:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$3(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Landroid/app/Activity;
    .locals 1
    .parameter

    .prologue
    .line 66
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    return-object v0
.end method

.method static synthetic access$4(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 48
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->context:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$5(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)Lcom/opongo/blogapp/manager/APIManager;
    .locals 1
    .parameter

    .prologue
    .line 52
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->apiManager:Lcom/opongo/blogapp/manager/APIManager;

    return-object v0
.end method

.method static synthetic access$6(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)[Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 70
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrderStrings:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$7(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)I
    .locals 1
    .parameter

    .prologue
    .line 73
    iget v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    return v0
.end method

.method static synthetic access$8(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)[Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 71
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDateStrings:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$9(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;)I
    .locals 1
    .parameter

    .prologue
    .line 74
    iget v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    return v0
.end method


# virtual methods
.method public destroyItem(Landroid/view/View;ILjava/lang/Object;)V
    .locals 2
    .parameter "pager"
    .parameter "p"
    .parameter "view"

    .prologue
    .line 255
    iget-object v1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v1, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/opongo/android/custom/PostListAdapter;

    .line 256
    .local v0, mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    const/4 v1, 0x0

    iput-object v1, v0, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    .line 257
    check-cast p1, Landroid/support/v4/view/ViewPager;

    .end local p1
    check-cast p3, Landroid/widget/ListView;

    .end local p3
    invoke-virtual {p1, p3}, Landroid/support/v4/view/ViewPager;->removeView(Landroid/view/View;)V

    .line 258
    return-void
.end method

.method protected doRefresh(ZI)V
    .locals 13
    .parameter "forceRefresh"
    .parameter "p"

    .prologue
    const/4 v10, 0x0

    const/4 v12, 0x1

    const/4 v11, 0x0

    .line 620
    iget-object v8, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v8}, Ljava/util/ArrayList;->size()I

    move-result v8

    if-le v8, p2, :cond_0

    .line 621
    iget-object v8, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v8, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/opongo/android/custom/PostListAdapter;

    .line 623
    .local v5, mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v8, v5, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    if-nez v8, :cond_1

    .line 658
    .end local v5           #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    :cond_0
    :goto_0
    return-void

    .line 626
    .restart local v5       #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    :cond_1
    iget-wide v2, v5, Lcom/opongo/android/custom/PostListAdapter;->lastrefresh:J

    .line 627
    .local v2, last_registerUser:J
    new-instance v8, Ljava/util/Date;

    invoke-direct {v8}, Ljava/util/Date;-><init>()V

    invoke-virtual {v8}, Ljava/util/Date;->getTime()J

    move-result-wide v6

    .line 629
    .local v6, now:J
    const-wide/32 v8, 0x493e0

    sub-long v8, v6, v8

    cmp-long v8, v2, v8

    if-ltz v8, :cond_2

    if-eqz p1, :cond_3

    .line 630
    :cond_2
    iget-boolean v8, v5, Lcom/opongo/android/custom/PostListAdapter;->isLockLoading:Z

    if-nez v8, :cond_3

    .line 632
    iput-boolean v12, v5, Lcom/opongo/android/custom/PostListAdapter;->isLockLoading:Z

    .line 633
    iput-wide v6, v5, Lcom/opongo/android/custom/PostListAdapter;->lastrefresh:J

    .line 636
    :try_start_0
    iget-object v4, v5, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    check-cast v4, Leu/erikw/PullToRefreshListView;

    .line 637
    .local v4, listview:Leu/erikw/PullToRefreshListView;
    invoke-virtual {v4}, Leu/erikw/PullToRefreshListView;->isRefreshing()Z
    :try_end_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0

    .line 642
    .end local v4           #listview:Leu/erikw/PullToRefreshListView;
    :goto_1
    sget-object v8, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->TAG:Ljava/lang/String;

    const-string v9, "doRefresh"

    invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 644
    new-instance v8, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$downloadOldPostsAsyncTask;

    invoke-direct {v8, p0, v10}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$downloadOldPostsAsyncTask;-><init>(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$downloadOldPostsAsyncTask;)V

    const/4 v9, 0x4

    new-array v9, v9, [Ljava/lang/Integer;

    invoke-static {v11}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    aput-object v10, v9, v11

    iget v10, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->postPage:I

    invoke-static {v10}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    aput-object v10, v9, v12

    const/4 v10, 0x2

    invoke-static {v12}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v11

    aput-object v11, v9, v10

    const/4 v10, 0x3

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v11

    aput-object v11, v9, v10

    invoke-virtual {v8, v9}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$downloadOldPostsAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto :goto_0

    .line 638
    :catch_0
    move-exception v0

    .line 639
    .local v0, e:Ljava/lang/NullPointerException;
    invoke-virtual {v0}, Ljava/lang/NullPointerException;->printStackTrace()V

    goto :goto_1

    .line 647
    .end local v0           #e:Ljava/lang/NullPointerException;
    :cond_3
    sget-object v8, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->TAG:Ljava/lang/String;

    const-string v9, "doRefresh locked"

    invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 648
    invoke-virtual {v5}, Lcom/opongo/android/custom/PostListAdapter;->removeListViewHeader()V

    .line 650
    invoke-virtual {v5}, Lcom/opongo/android/custom/PostListAdapter;->isEmpty()Z

    move-result v8

    if-eqz v8, :cond_0

    .line 651
    iget-object v8, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 652
    const-string v9, "layout_inflater"

    invoke-virtual {v8, v9}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v8

    .line 651
    check-cast v8, Landroid/view/LayoutInflater;

    .line 653
    const v9, 0x7f03000c

    invoke-virtual {v8, v9, v10, v11}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v1

    .line 654
    .local v1, footerView:Landroid/view/View;
    invoke-virtual {v5, v1, v10}, Lcom/opongo/android/custom/PostListAdapter;->setListViewFooter(Landroid/view/View;Landroid/widget/ListView;)V

    goto :goto_0
.end method

.method public doRefresh(ZII)V
    .locals 1
    .parameter "forceRefresh"
    .parameter "p"
    .parameter "post_id"

    .prologue
    .line 615
    iput p3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->post_id:I

    .line 616
    const/4 v0, 0x1

    invoke-virtual {p0, v0, p2}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->doRefresh(ZI)V

    .line 617
    return-void
.end method

.method public doRefreshAll()V
    .locals 9

    .prologue
    const/4 v8, 0x0

    .line 559
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    array-length v5, v5

    if-lt v3, v5, :cond_0

    .line 580
    return-void

    .line 560
    :cond_0
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    if-le v5, v3, :cond_1

    .line 561
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v5, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/opongo/android/custom/PostListAdapter;

    .line 563
    .local v4, mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "SELECT * FROM "

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v7}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " WHERE id = 0"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    .line 565
    .local v1, cursor:Landroid/database/Cursor;
    invoke-virtual {v4}, Lcom/opongo/android/custom/PostListAdapter;->getCursor()Landroid/database/Cursor;

    move-result-object v0

    .line 566
    .local v0, currentcursor:Landroid/database/Cursor;
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v5, v0}, Landroid/app/Activity;->stopManagingCursor(Landroid/database/Cursor;)V

    .line 568
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v5, v1}, Landroid/app/Activity;->startManagingCursor(Landroid/database/Cursor;)V

    .line 569
    invoke-virtual {v4, v1}, Lcom/opongo/android/custom/PostListAdapter;->changeCursor(Landroid/database/Cursor;)V

    .line 571
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 572
    const-string v6, "layout_inflater"

    invoke-virtual {v5, v6}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v5

    .line 571
    check-cast v5, Landroid/view/LayoutInflater;

    .line 573
    const v6, 0x7f03000e

    const/4 v7, 0x0

    invoke-virtual {v5, v6, v8, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v2

    .line 574
    .local v2, footerView:Landroid/view/View;
    invoke-virtual {v4, v2, v8}, Lcom/opongo/android/custom/PostListAdapter;->setListViewFooter(Landroid/view/View;Landroid/widget/ListView;)V

    .line 575
    const-wide/16 v5, 0x0

    iput-wide v5, v4, Lcom/opongo/android/custom/PostListAdapter;->lastrefresh:J

    .line 577
    const/4 v5, 0x1

    invoke-virtual {p0, v5, v3}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->doRefresh(ZI)V

    .line 559
    .end local v0           #currentcursor:Landroid/database/Cursor;
    .end local v1           #cursor:Landroid/database/Cursor;
    .end local v2           #footerView:Landroid/view/View;
    .end local v4           #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    :cond_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method public doRefreshWithFilter(II)V
    .locals 9
    .parameter "order"
    .parameter "date"

    .prologue
    const/4 v8, 0x0

    .line 583
    iput p1, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    .line 584
    iput p2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    .line 586
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v6, "filterOrder"

    iget v7, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterOrder:I

    invoke-interface {v5, v6, v7}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 587
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v6, "filterDate"

    iget v7, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->filterDate:I

    invoke-interface {v5, v6, v7}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 588
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {v5}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 590
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    array-length v5, v5

    if-lt v3, v5, :cond_0

    .line 612
    return-void

    .line 591
    :cond_0
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    if-le v5, v3, :cond_1

    .line 592
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v5, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/opongo/android/custom/PostListAdapter;

    .line 594
    .local v4, mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "SELECT * FROM "

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v7}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " WHERE id = 0"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    .line 596
    .local v1, cursor:Landroid/database/Cursor;
    invoke-virtual {v4}, Lcom/opongo/android/custom/PostListAdapter;->getCursor()Landroid/database/Cursor;

    move-result-object v0

    .line 597
    .local v0, currentcursor:Landroid/database/Cursor;
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v5, v0}, Landroid/app/Activity;->stopManagingCursor(Landroid/database/Cursor;)V

    .line 599
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v5, v1}, Landroid/app/Activity;->startManagingCursor(Landroid/database/Cursor;)V

    .line 600
    invoke-virtual {v4, v1}, Lcom/opongo/android/custom/PostListAdapter;->changeCursor(Landroid/database/Cursor;)V

    .line 603
    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 604
    const-string v6, "layout_inflater"

    invoke-virtual {v5, v6}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v5

    .line 603
    check-cast v5, Landroid/view/LayoutInflater;

    .line 605
    const v6, 0x7f03000e

    const/4 v7, 0x0

    invoke-virtual {v5, v6, v8, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v2

    .line 606
    .local v2, footerView:Landroid/view/View;
    invoke-virtual {v4, v2, v8}, Lcom/opongo/android/custom/PostListAdapter;->setListViewFooter(Landroid/view/View;Landroid/widget/ListView;)V

    .line 607
    const-wide/16 v5, 0x0

    iput-wide v5, v4, Lcom/opongo/android/custom/PostListAdapter;->lastrefresh:J

    .line 609
    const/4 v5, 0x1

    invoke-virtual {p0, v5, v3}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->doRefresh(ZI)V

    .line 590
    .end local v0           #currentcursor:Landroid/database/Cursor;
    .end local v1           #cursor:Landroid/database/Cursor;
    .end local v2           #footerView:Landroid/view/View;
    .end local v4           #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    :cond_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method public finishUpdate(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 268
    return-void
.end method

.method public getCount()I
    .locals 1

    .prologue
    .line 138
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    array-length v0, v0

    return v0
.end method

.method public getTitle(I)Ljava/lang/String;
    .locals 1
    .parameter "position"

    .prologue
    .line 133
    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->titles:[Ljava/lang/String;

    aget-object v0, v0, p1

    return-object v0
.end method

.method public instantiateItem(Landroid/view/View;I)Ljava/lang/Object;
    .locals 15
    .parameter "pager"
    .parameter "p"

    .prologue
    .line 144
    const/4 v14, 0x0

    .line 147
    .local v14, v:Leu/erikw/PullToRefreshListView;
    const/4 v1, 0x0

    .line 149
    .local v1, mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v3}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v3

    move/from16 v0, p2

    invoke-virtual {v2, v3, v0}, Lcom/opongo/blogapp/manager/DatabaseManager;->queryForBlogTypeID(Ljava/lang/String;I)I

    move-result v8

    .line 152
    .local v8, blogTypeID:I
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->query:Ljava/lang/String;

    const/4 v3, 0x2

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    invoke-static {v8}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v3, v4

    const/4 v4, 0x1

    iget-object v6, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->order:[Ljava/lang/String;

    aget-object v6, v6, p2

    aput-object v6, v3, v4

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v13

    .line 155
    .local v13, queryFormat:Ljava/lang/String;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v2, v13}, Lcom/opongo/blogapp/manager/DatabaseManager;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v5

    .line 157
    .local v5, cursor:Landroid/database/Cursor;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    move/from16 v0, p2

    if-le v2, v0, :cond_0

    .line 158
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    move/from16 v0, p2

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    .end local v1           #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    check-cast v1, Lcom/opongo/android/custom/PostListAdapter;

    .line 160
    .restart local v1       #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    invoke-virtual {v1}, Lcom/opongo/android/custom/PostListAdapter;->getCursor()Landroid/database/Cursor;

    move-result-object v9

    .line 161
    .local v9, currentcursor:Landroid/database/Cursor;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v2, v9}, Landroid/app/Activity;->stopManagingCursor(Landroid/database/Cursor;)V

    .line 163
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v2, v5}, Landroid/app/Activity;->startManagingCursor(Landroid/database/Cursor;)V

    .line 164
    invoke-virtual {v1, v5}, Lcom/opongo/android/custom/PostListAdapter;->changeCursor(Landroid/database/Cursor;)V

    .line 173
    .end local v9           #currentcursor:Landroid/database/Cursor;
    :goto_0
    iget-object v2, v1, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    if-nez v2, :cond_1

    .line 174
    new-instance v12, Leu/erikw/PullToRefreshListView;

    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-direct {v12, v2}, Leu/erikw/PullToRefreshListView;-><init>(Landroid/content/Context;)V

    .line 176
    .local v12, listView:Leu/erikw/PullToRefreshListView;
    new-instance v2, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$1;

    move/from16 v0, p2

    invoke-direct {v2, p0, v0}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$1;-><init>(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;I)V

    invoke-virtual {v12, v2}, Leu/erikw/PullToRefreshListView;->setOnRefreshListener(Leu/erikw/PullToRefreshListView$OnRefreshListener;)V

    .line 183
    iput-object v12, v1, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    .line 184
    move-object v14, v12

    .line 189
    .end local v12           #listView:Leu/erikw/PullToRefreshListView;
    :goto_1
    invoke-virtual {v1}, Lcom/opongo/android/custom/PostListAdapter;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_2

    .line 190
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 191
    const-string v3, "layout_inflater"

    invoke-virtual {v2, v3}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    .line 190
    check-cast v2, Landroid/view/LayoutInflater;

    .line 192
    const v3, 0x7f03000d

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v14, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v10

    .line 193
    .local v10, footerView:Landroid/view/View;
    const/4 v2, 0x0

    invoke-virtual {v1, v10, v2}, Lcom/opongo/android/custom/PostListAdapter;->setListViewFooter(Landroid/view/View;Landroid/widget/ListView;)V

    .line 202
    .end local v10           #footerView:Landroid/view/View;
    :goto_2
    invoke-virtual {v14, v1}, Leu/erikw/PullToRefreshListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 204
    new-instance v2, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$2;

    move/from16 v0, p2

    invoke-direct {v2, p0, v0}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$2;-><init>(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;I)V

    invoke-virtual {v14, v2}, Leu/erikw/PullToRefreshListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 234
    const/4 v2, 0x0

    move/from16 v0, p2

    invoke-virtual {p0, v2, v0}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->doRefresh(ZI)V

    .line 236
    check-cast p1, Landroid/support/v4/view/ViewPager;

    .end local p1
    const/4 v2, 0x0

    move-object/from16 v0, p1

    invoke-virtual {v0, v14, v2}, Landroid/support/v4/view/ViewPager;->addView(Landroid/view/View;I)V

    .line 238
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    aget v2, v2, p2

    invoke-virtual {v14, v2}, Leu/erikw/PullToRefreshListView;->setSelection(I)V

    .line 240
    new-instance v2, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$3;

    move/from16 v0, p2

    invoke-direct {v2, p0, v0}, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter$3;-><init>(Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;I)V

    invoke-virtual {v14, v2}, Leu/erikw/PullToRefreshListView;->setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V

    .line 250
    return-object v14

    .line 166
    .restart local p1
    :cond_0
    new-instance v1, Lcom/opongo/android/custom/PostListAdapter;

    .end local v1           #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 167
    const v4, 0x7f030018

    iget-object v6, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-virtual {v6}, Lcom/opongo/blogapp/manager/DatabaseManager;->getTableName()Ljava/lang/String;

    move-result-object v6

    iget-object v7, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

    .line 166
    invoke-direct/range {v1 .. v7}, Lcom/opongo/android/custom/PostListAdapter;-><init>(Landroid/app/Activity;Landroid/content/Context;ILandroid/database/Cursor;Ljava/lang/String;Lcom/opongo/blogapp/manager/DatabaseManager;)V

    .line 168
    .restart local v1       #mAdapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v2, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 170
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    invoke-virtual {v2, v5}, Landroid/app/Activity;->startManagingCursor(Landroid/database/Cursor;)V

    goto :goto_0

    .line 186
    :cond_1
    iget-object v14, v1, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    .end local v14           #v:Leu/erikw/PullToRefreshListView;
    check-cast v14, Leu/erikw/PullToRefreshListView;

    .restart local v14       #v:Leu/erikw/PullToRefreshListView;
    goto :goto_1

    .line 195
    :cond_2
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->activity:Landroid/app/Activity;

    .line 196
    const-string v3, "layout_inflater"

    invoke-virtual {v2, v3}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    .line 195
    check-cast v2, Landroid/view/LayoutInflater;

    .line 197
    const v3, 0x7f03000e

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v14, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v11

    .line 198
    .local v11, header:Landroid/view/View;
    const/4 v2, 0x0

    invoke-virtual {v1, v11, v2}, Lcom/opongo/android/custom/PostListAdapter;->setListViewHeader(Landroid/view/View;Landroid/widget/ListView;)V

    .line 199
    iget-object v2, v1, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    invoke-virtual {v2, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    goto :goto_2
.end method

.method public isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
    .locals 1
    .parameter "view"
    .parameter "object"

    .prologue
    .line 262
    invoke-virtual {p1, p2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public restoreState(Landroid/os/Parcelable;Ljava/lang/ClassLoader;)V
    .locals 6
    .parameter "p"
    .parameter "c"

    .prologue
    .line 272
    instance-of v3, p1, Lcom/opongo/blogapp/utils/ScrollState;

    if-eqz v3, :cond_0

    .line 273
    check-cast p1, Lcom/opongo/blogapp/utils/ScrollState;

    .end local p1
    invoke-virtual {p1}, Lcom/opongo/blogapp/utils/ScrollState;->getScrollPos()[I

    move-result-object v3

    iput-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    .line 276
    :cond_0
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_1
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_2

    .line 287
    return-void

    .line 276
    :cond_2
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/opongo/android/custom/PostListAdapter;

    .line 277
    .local v0, adapter:Lcom/opongo/android/custom/PostListAdapter;
    iget-object v4, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->mAdapterArray:Ljava/util/ArrayList;

    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->indexOf(Ljava/lang/Object;)I

    move-result v2

    .line 279
    .local v2, pos:I
    :try_start_0
    iget-object v4, v0, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    if-eqz v4, :cond_1

    .line 280
    iget-object v4, v0, Lcom/opongo/android/custom/PostListAdapter;->listView:Landroid/widget/ListView;

    iget-object v5, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    aget v5, v5, v2

    invoke-virtual {v4, v5}, Landroid/widget/ListView;->setSelection(I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 281
    :catch_0
    move-exception v1

    .line 283
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public saveState()Landroid/os/Parcelable;
    .locals 2

    .prologue
    .line 291
    new-instance v1, Lcom/opongo/blogapp/utils/ScrollState;

    iget-object v0, p0, Lcom/opongo/android/custom/SpicyDealsViewPagerAdapter;->scrollPosition:[I

    invoke-virtual {v0}, [I->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [I

    invoke-direct {v1, v0}, Lcom/opongo/blogapp/utils/ScrollState;-><init>([I)V

    return-object v1
.end method

.method public startUpdate(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 298
    return-void
.end method
